<@override name="title">
    <#if oper=="create">
    新建游戏礼品
    <#else>
    编辑游戏礼品
    </#if>
</@override>

<@override name="viewbody">
<div class="row">
    <div class="col-md-12">
        <h3 class="page-title">
            游戏管理
            <small>
                <#if oper=="create">
                    创建新的游戏礼品
                <#else>
                    修改已有游戏礼品
                </#if>
            </small>
        </h3>
        <ul class="page-breadcrumb breadcrumb">
            <li>
                <i class="fa fa-home"></i>
                <a href="${ctx}/admin/home">
                    首页
                </a>
                <i class="fa fa-angle-right"></i>
            </li>
            <li>
                <a href="${ctx}/admin/game/gift">
                    礼品设置
                </a>
                <i class="fa fa-angle-right"></i>
            </li>
            <li>
                <a href="#">
                    <#if oper=="create">
                        新建游戏礼品
                    <#else>
                        编辑游戏礼品
                    </#if>
                </a>
            </li>
        </ul>
    </div>
</div>

<form class="form-horizontal" action="${ctx}/admin/game/gift/save" role="form" id="dataForm" method="post">
    <div class="panel panel-default">
        <div class="panel-heading"><h6 class="panel-title">游戏礼品信息</h6></div>
        <div class="panel-body">
            <input name="gift.id" type="hidden" value="${gift.id!}"/>

            <div class="form-group">
                <label class="col-sm-2 control-label" for="gift.name">礼品名称: <span class="mandatory">*</span></label>

                <div class="col-sm-9">
                    <input type="text" class="form-control" name="gift.name" id="gift.name" value="${gift.name!}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label" for="gift.description">描述: </label>

                <div class="col-sm-9">
                    <textarea class="form-control" rows="3" name="gift.description" id="gift.description">${gift.description!}</textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label" for="gift.status">启用状态: <span class="mandatory">*</span></label>

                <div class="col-sm-9 radio-list">
                    <label class="radio-inline">
                        <input type="radio" name="gift.status" id="gift.status" value="1" <#if gift.status??>${gift.status?string('checked', '')}</#if>> 启用 </label>
                    <label class="radio-inline">
                        <input type="radio" name="gift.status" id="gift.status" value="0" <#if gift.status??>${gift.status?string('', 'checked')}</#if>> 不启用 </label>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label" for="gift.sequence">排序: <span class="mandatory">*</span></label>

                <div class="col-sm-9">
                    <input type="text" class="form-control" name="gift.sequence" id="gift.sequence" value="${gift.sequence!}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label" for="gift.style">礼品类型: <span class="mandatory">*</span></label>

                <div class="col-sm-9">
                    <select class="form-control" name="gift.style" id="giftStyle">
                        <option value="1" <#if gift.style?? && gift.style == 1>selected="selected"</#if>>礼品</option>
                        <option value="2" <#if gift.style?? && gift.style == 2>selected="selected"</#if>>中南币</option>
                    <#--<option value="3" <#if gift.style?? && gift.style == 3>selected="selected"</#if>>积分</option>-->
                    </select>
                </div>
            </div>

            <div class="form-group" id="giftValue" <#if gift.style?? && gift.style == 1>style="display: none;"</#if>>
                <label class="col-sm-2 control-label" for="gift.value">兑换值: </label>

                <div class="col-sm-9">
                    <input type="text" class="form-control" name="gift.value" id="gift.value" value="${gift.value!}">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label" for="gift.effive_start">有效开始时间: <span class="mandatory">*</span></label>

                <div class="col-sm-9">
                    <div class="input-group input-medium date  form_datetime" data-link-field="effive_start">
                        <input class="form-control" size="16" type="text" value="${gift.effive_start!}" name="gift.effive_start" id="effive_start">
                        <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
                        <span class="input-group-addon"><span class="glyphicon glyphicon-th"></span></span>
                    </div>
                    <input type="hidden" id="gift.effive_start" name="effive_start" value="" />
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label" for="gift.effive_start">有效结束时间: <span class="mandatory">*</span></label>

                <div class="col-sm-9">
                    <div class="input-group input-medium date  form_datetime" data-link-field="effive_end">
                        <input class="form-control" size="16" type="text" value="${gift.effive_end!}" name="gift.effive_end" id="effive_end">
                        <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
                        <span class="input-group-addon"><span class="glyphicon glyphicon-th"></span></span>
                    </div>
                    <input type="hidden" id="gift.effive_end" name="effive_end" value="" />
                </div>
            </div>
        </div>

       <#-- <div class="form-group">

            <label class="col-sm-2 control-label" for="picture"></label>

            <div class="col-lg-2 col-md-4 col-sm-4">
                <p class="form-control-static">
                    <input id="giftAttachmentUpload" type="file" class="btn">
                </p>
            </div>
            <input type="hidden" id="picture" name="gift.img" value="${gift.img!}">
        </div>-->

        <div class="form-group">

            <label class="col-md-2 control-label">礼品图片：</label>

            <div class="col-md-9 single_pic">
                <input type="hidden" id="picture" name="gift.img" value="${gift.img!}">
                <input id="giftAttachmentUpload" type="file" class="btn">

                <div class="picture" id="show_picture" style="display: ${(gift.img??)?string('display','none')};">
                    <a href="<#if gift.img??>${ctx}/${gift.img}</#if>"
                       class="thumbnail fancybox-button" id="box_picture" data-rel="logo">
                        <img src="<#if gift.img??>${ctx}/${gift.img?replace('.','.thumbnail.')}</#if>"
                             alt=""/>
                    </a>
                    <a href="#" class="action" data-hook="remove_picture" data-target="#picture"
                       data-data="${gift.img!}"><i class="fa fa-times"></i> </a>
                </div>
            </div>
        </div>

        <#--<div class="form-group" id="show_picture"
             style="display: ${(gift.img??)?string('display','none')};">
            <label class="col-sm-2 control-label text-right">礼品图片:</label>


            <div class="col-lg-2 col-md-4 col-sm-4 single_pic">
                <a href="<#if gift.img??>${ctx}/${gift.img}</#if>" title="点击显示大图"
                   class="thumbnail fancybox-button" id="box_picture" data-rel="fancybox-button">
                    <img src="<#if gift.img??>${ctx}/${gift.img?replace('.','.thumbnail.')}</#if>"
                         alt=""/>
                </a>
                <a href="#" class="action" data-hook="remove_picture" data-target="#mo_prictures"
                   data-data="${pic!}"><i class="fa fa-times"></i> </a>
            </div>
        </div>-->

        <div class="form-actions text-right">
            <a class="btn default yellow-stripe" href="${ctx}/admin/game/gift">返回</a>
            <input type="submit" value="保存" class="btn btn-primary">
        </div>
    </div>
    </div>
</form>
</@override>

<@override name="viewmodule">gift_item</@override>

<@extends name="../../_basic/main.ftl"></@extends>
